package cn.wolfcode.enums;

import lombok.Getter;

/**
 * 预约单枚举类
 */
@Getter
public enum ConsumptionStatusEnum {
    CONSUME("待结算",0),
    AUDIT("待审核",1),
    FINISH("归档",2),
    FAILURE("坏账",3);

    private String name;
    private Integer value;
    ConsumptionStatusEnum(String name, Integer value){
        this.name = name;
        this.value = value;
    }
    //传入value来找到name
    public static String findName(Integer value){
        ConsumptionStatusEnum[] enums = ConsumptionStatusEnum.values();
        for (ConsumptionStatusEnum anEnum : enums) {
            if (anEnum.getValue().equals(value)) {
                return anEnum.getName();
            }
        }
        return null;
    }
}
